<assign name="page_title" value="修改密码" />
<include file="Public:header" />

<div id="main">
    <div id="main-header" class="grid page">
        <h2>爱咕噜</h2>
        <h1>修改密码</h1>
    </div>
    <div id="sub-main-header"></div>
    <div id="main-inner" class="account_password page grid">
        <h3>修改密码</h3>
        <hr class="dash" />
        <form action="__URL__/save" method="post" class="ajaxform">
            <table class="edit">
                <tr>
                    <td class="label small" width="30%">原密码</td>
                    <td><input class="text" type="password" name="oldpassword" required="required" value="" autocomplete="off"></td>
                </tr>
                <tr>
                    <td class="label small">新密码</td>
                    <td><input class="text" placeholder="••••••••" type="password" name="password" required="required" value=""></td>
                </tr>
                <tr>
                    <td class="label small">确认新密码</td>
                    <td><input class="text" placeholder="••••••••" type="password" name="repassword" required="required" data-equals="password" value=""></td>
                </tr>
                <tr>
                    <td class="label small"></td>
                    <td><button class="btn btn_silver fbold" type="submit"><span>保存修改</span></button></td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script>
    Do("validator",function(){
        $("form.ajaxform").validator().submit(function(e){
            var form = $(this);
            if (!e.isDefaultPrevented()) {
                Cute.api.post(form.attr("action"),form.serializeArray(), function(json){
                    if(json.status > 0){
                        new Cute.ui.dialog().suggest(json.info);
                        form[0].reset();
                    }else{
                        form.data("validator").invalidate(json.info);
                    }
                });
                e.preventDefault();
            }
        });
    });
</script>
<include file="Public:footer" />